<template>
  <div class='detail'>
    <p>下载附件：<span v-if="!formalInfo.files">暂无</span><span v-for="(item,index) in formalInfo.files"><a @click.stop.prevent="download(item)" href="" class="color-green">附件{{index}}</a></span></p>
    <img @click.stop.prevent="showBigImg(formalInfo.imgs,index)" v-for="(item, index) in formalInfo.imgs" :key="index" :src="item" alt="">
  </div>
</template>
<script>
export default {
  props:['info'],
  components: {},
  name: "",
  data() {
    return {};
  },
  computed:{
    formalInfo(){
      return this.info||{}
    }
  },
  methods:{
    download(item){
      location.href=item
    },

    showBigImg(item,index){
      const instance = ImagePreview({
        images: item,
        startPosition:index,
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.detail {
  p{
    font-size: 13px;
    color: #666;

    .color-green{
      text-decoration: underline;
    }
  }
  img{
    max-width: 100%;
    margin: 10px 0;
  }
}
</style>